#include <QtCore>
#include <QtGui>
#include <QtNetwork>

#include "ksysprofiles.h"
#include "ui_ksysprofiles.h"

kSysProfiles::kSysProfiles(QWidget *parent) :
    QDialog(parent),
    m_ui(new Ui::kSysProfiles)
{
    m_ui->setupUi(this);
}

kSysProfiles::~kSysProfiles()
{
    delete m_ui;
}

void kSysProfiles::changeEvent(QEvent *e)
{
    QDialog::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        m_ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void kSysProfiles::on_btnGenerate_clicked()
{
    QSettings settings("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion",
                        QSettings::NativeFormat);
    QString hash(QByteArray(settings.value( "ProductId" ).toByteArray()).toBase64());
    hash.chop(2);

    m_ui->lineEditSysID->setText( hash );
}
